#!/bin/sh

filename=$1
if [ -z ${filename} ]
then
	echo "please input the filename:"
	read filename	
fi

count=`wc ${filename}.array.top50 | awk '{print $1}'`
mkdir ${filename}
cp ${filename}.array.top50 ${filename}/

echo '#!/bin/sh' > ${filename}.sh
cat ${filename}.array.top50 >> ${filename}.sh


echo "
	echo \"${filename}\"
	i=0
	while [ \$i -le $((count-1)) ]
	do
		cp \${top[i]}.*.whole.return ${filename}/
		i=\$((i+1))
	done
" >> ${filename}.sh

chmod a+x *.sh

./${filename}.sh
rm  ${filename}.sh
